#include <skia_framework.h>

#include <include/core/SkCanvas.h>
#include <include/effects/Sk1DPathEffect.h>

int main()
{
    SkiaFramework sf;
    sf.SetDrawFunc([](SkCanvas &canvas) {
        SkPaint paint;
        paint.setAntiAlias(true);
        paint.setColor(0xffff0000);
        paint.setStyle(paint.kStroke_Style);

        SkPath path;
        auto thickness = 0.5f;
        path.moveTo({0, 2 - thickness});
        path.quadTo({1, 0 - thickness}, {2, 2 - thickness});
        path.lineTo({3, 4 - thickness});
        path.quadTo({4, 6 - thickness}, {5, 4 - thickness});
        path.lineTo({6, 2 - thickness});
        path.lineTo({6, 2 + thickness});
        path.lineTo({5, 4 + thickness});
        path.quadTo({4, 6 + thickness}, {3, 4 + thickness});
        path.lineTo({2, 2 + thickness});
        path.quadTo({1, 0 + thickness}, {0, 2 + thickness});
        path.lineTo({0, 2 - thickness});

        paint.setPathEffect(
            SkPath1DPathEffect::Make(path, 6, 0, SkPath1DPathEffect::kRotate_Style));
        canvas.drawLine({100, 100}, {200, 100}, paint);
    });
    sf.Run();
    return 0;
}
